Skip to content

Conversation

rachelks
Copy link
Member

@rachelks rachelks commented Sep 16, 2026

Summary

Adds an expand/collapse control for books with long OpenLibrary subject lists.

The collapsed view shows up to three subject tags. Any remaining subjects are available through a Show N more subjects button.

When expanded, all subjects are shown. The list can be collapsed again with the Show fewer subjects control.

Changes

  • Replaced the passive +N more indicator with an accessible expand/collapse button
  • Shows up to three subject tags in the collapsed view
  • Keeps the remaining-subject count accurate based on the three-subject limit
  • Shows all remaining subjects when expanded
  • Provides a Show fewer subjects control to collapse the list again
  • Resets expanded state when switching books
  • Preserves wrapping on narrow screens
  • Added/updated tests for subject visibility, expansion, collapse, remaining counts, and switching books

Testing

  • npm run format:check
  • npm run lint
  • npm test
  • npm run build
  • Manually verified collapsed and expanded subject lists on desktop and narrow screens

AI assistance

AI was used to assist with implementation and test development. The changes were reviewed and manually verified before submission.

Closes #39

@rachelks rachelks added type: feature New functionality or requirement area: ui React components, presentation, navigation priority: high Required for first delivery status: in-review PR is open and awaiting review ai-assisted Substantial AI-generated code (documented per spec) labels Sep 16, 2026
@rachelks rachelks added this to the M4 — Quality milestone Sep 16, 2026
@rachelks rachelks self-assigned this Sep 16, 2026
@rachelks rachelks requested a review from a team as a code owner September 16, 2026 17:03
@rachelks rachelks linked an issue Sep 16, 2026 that may be closed by this pull request
15 tasks
@rachelks
Copy link
Member Author

After testing the layout with long subject names, it seemed natural to adjust the
collapsed behavior slightly. It now shows up to five complete subjects that
fit in the reserved area rather than allowing a subject tag to be clipped.

Expanded subjects use a scrollable area so the BookCard can keep a stable
layout. The acceptance criteria in #39 have been updated to reflect this.

Copy link
Member

@robertky robertky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying the intended behavior. I can see that the updated acceptance criteria require the expanded subjects to appear in a vertically scrollable area without changing the BookCard size. I cannot see a corresponding code change or test for that in the current PR yet. Could you push that implementation before I approve?

@rachelks
Copy link
Member Author

Thanks for catching this! I realized that the scrollable subject area and stable BookCard size belong to #40, which handles the BookCard layout. I've updated #39 and the PR description so this PR now only covers the expand/collapse behavior.

I also simplified the collapsed view to a fixed maximum of three subjects and pushed the updated implementation and tests. All checks are passing now. Could you take another look when you have time?

Copy link
Member

@robertky robertky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The updated scope is clear, and the expand/collapse behavior works as intended with the state resetting when switching books.

@robertky robertky merged commit 426b740 into main Sep 17, 2026
1 check passed
Sign in to join this conversation on GitHub.
Labels
ai-assisted Substantial AI-generated code (documented per spec) area: ui React components, presentation, navigation priority: high Required for first delivery status: in-review PR is open and awaiting review type: feature New functionality or requirement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: let users expand long book subject lists
2 participants